import operate from '@dfeidao/atom-nodejs/db/operate';



interface Message {
	client_type: string;
	formid: string;
	productid: string;
}
export default async function atom(msg: Message, action_id: string, session_id: string) {
	const systemid = '12';
	const { exec, del } = operate(action_id, session_id, systemid);
	// const { prepare, exec } = del(action_id, session_id, spaceid, systemid);
	del('pub_form_code', { formid: msg.formid, productid: msg.productid });
	// const ret1 = await exec();
	del('pub_form', { formid: msg.formid, client_type: msg.client_type, productid: msg.productid });
	const ret = await exec();
	if (ret.code === 1) {
		return 'success';
	} else {
		return 'fail';
	}
}
